MyDataFunction
The sequence grabber calls your data function whenever any of the grabber's channels write digitized data to the destination movie file. You assign a data function to the sequence grabber by calling theSGSetDataProc
function, which is discussed on page 5-32.Your data function must support the following interface:
pascal OSErr MyDataFunction (SGChannel c, Ptr p, long len, long *offset, long chRefCon, TimeValue time, short writeType, long refCon);
c
- Identifies the channel component that is writing the digitized data.
p
- Contains a pointer to the digitized data.
len
- Indicates the number of bytes of digitized data.
offset
- Contains a pointer to a field that may specify where you are to write the digitized data, and that is to receive a value indicating where you wrote the data. You must update the field referred to by this parameter, supplying the value indicated by the
writeType
parameter.chRefCon
- Contains control information. The low-order 16 bits contain sample flags for use by the Movie Toolbox's
AddMediaSample
function (see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for information about these flags). The sequence grabber sets these flags as appropriate.- The high-order 16 bits are reserved for Apple and are always set to 0.
time
- Identifies the starting time of the data, in the channel's time scale. You may use the
SGGetChannelTimeScale
function to retrieve the channel's time scale (discussed on page 5-65).writeType
- Indicates the type of write operation being performed. The following values are defined:
seqGrabWriteAppend
- Append the new data to the end of the file. Set the field referred to by the offset parameter to reflect the location at which you added the data.
seqGrabWriteReserve
- Do not write any data to the output file. Instead, reserve space in the output file for the amount of data indicated by the
len
parameter. Set the field referred to by theoffset
parameter to the location of the reserved space.seqGrabWriteFill
Write the data into the location specified by the field referred to by theoffset
parameter. Set that field to the location of the byte following the last byte you wrote.- This option is used to fill the space reserved previously when the
writeType
parameter was set toseqGrabWriteReserve
. Note that the sequence grabber may call your data function several times to fill a single reserved location.refCon
- Contains the reference constant you specified when you assigned your data function to the sequence grabber.
DESCRIPTION
The sequence grabber calls your data function whenever any channel component writes data to the destination movie. You may use your data function to store the digitized data in some format other than a QuickTime movie.RESULT CODES
File Manager errors
Memory Manager errorsSEE ALSO
You can instruct the sequence grabber not to write its data to a QuickTime movie by calling theSGSetDataOutput
function and setting theseqGrabDontMakeMovie
flag to 1. This can save processing time in cases where you do not want to create or update a movie.SGSetDataOutput
is discussed on page 5-24.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help